//
//  Object.cpp
//  TrackingSim
//
//  Created by Garrett Manka on 1/28/12.
//  Copyright (c) 2012. All rights reserved.
//

#include <graphics/Object.h>

Object::Object()
{

}

void Object::setName( const std::string& name )
{
    m_name = name;
}

void Object::setMeshGroup(const std::string& mesh_group)
{
    m_mesh_group = mesh_group;
}

void Object::setGroupID(int group_id)
{
    m_group_id = group_id;
}

void Object::addVertex( const Vertex& v , int abs_vertex_index )
{
    m_vertex_list.push_back(v);
    m_absolute_vertex_index_map[ abs_vertex_index ] = (int)m_vertex_list.size() - 1;
}

void Object::addNormal( const Normal& n , int abs_normal_index )
{
    m_normal_list.push_back(n);
    m_absolute_normal_index_map[ abs_normal_index ] = (int)m_normal_list.size() - 1;
}

void Object::addFace( const Face& f )
{
    m_face_list.push_back(f);
}

const std::string& Object::getName() const
{
    return m_name;
}

const std::string& Object::getMeshGroup() const
{
    return m_mesh_group;
}

const int Object::getGroupID() const
{
    return m_group_id;
}

const std::vector<Vertex>& Object::getVertexList() const
{
    return m_vertex_list;
}

const std::vector<Normal>& Object::getNormalList() const
{
    return m_normal_list;
}

const std::vector<Face>& Object::getFaceList() const
{
    return m_face_list;
}

int Object::getLocalVertexIndex( int abs_vertex_index )
{
    return m_absolute_vertex_index_map[ abs_vertex_index ];
}

int Object::getLocalNormalIndex( int abs_normal_index )
{
    return m_absolute_normal_index_map[ abs_normal_index ];
}